package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.StyleSheet;
	import flash.text.TextField;
	import flash.text.TextFormat;
	
	public class TestTextField extends Sprite
	{
		public function TestTextField()
		{
			super();
			
			var text1:TextField = new TextField();
			text1.height = 35;
			text1.border = true;
			text1.wordWrap = true;
			text1.text = "abcdefg,jkjdidfjdkdsjfsdjfsdjflsdjlfjsdfjsjlsdjflsdlj" +
				"sdfjsdfjsdlfkjsdf, dsfjsdfjsdklfjsd, sdfjsdlkfjsd;sdfsdfjdsfj" +
				"sdfksdjfdslkjfsdlfj, dsfsdflsdfj,dsfsdf,dsff  fdsfsdfsdfsdfd";
			text1.selectable = true;
			text1.scrollV = 2;
			trace("bottomScrollV="+text1.bottomScrollV+", maxScrollV="+text1.maxScrollV);
			trace("mouseWheelEnable = "+text1.mouseWheelEnabled);
			this.addChild(text1);
			text1.addEventListener(Event.SCROLL, onMouseScroll);
			
			var text2:TextField = new TextField();
			text2.x = 110;
			text2.border = true;
			text2.wordWrap = true;

			this.addChild(text2);
			
//			var textFormat:TextFormat = new TextFormat();
//			textFormat.color = 0xffff0000;
//			textFormat.bold = true;
//			textFormat.blockIndent = 5;
//			text2.setTextFormat(textFormat);
			var css:StyleSheet = new StyleSheet();
			var cssStr:Object = {color:"#ff00ff",fontWeight:"bold"};
			css.setStyle("p", {color:"#ff0000"});
			css.setStyle(".sample", cssStr);
			text2.styleSheet = css;
			text2.htmlText = "<p><span class='sample'>abcdefg,hijklmn,</span> opqrstuvwxyz, uuiouewrewio, sdfjsdfjslsdf" +
				"sfsfjjdsfj,sdfsdiierweoo,,dsfjsdjjdsfj</p>";
		}
		
		public	function	onMouseScroll(evt:Event):void{
			trace("scroll");
		}
	}
}